package org.example.springbook.model;

import lombok.Data;

@Data
public class PageRequest {
    private Integer currentPage=1;
    private Integer pageSize=10;

    private Integer offset;

    //为什么有了lombok注解之后 还要getter方法呢?
    //因为这个getter方法里面还要有offset计算逻辑
    public Integer getOffset() {
        return (currentPage - 1) * pageSize;
    }

}
